package com.msmall.community.team.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.msmall.base.model.BaseObject;

/**
 * 当创建组的话题时，可以选择是否分享到特定的公共版区和联盟组
 * 如果分享到公共版区，则Topic.enabled=CONSTANTDB.AVALIABLE & TeamTopic.sharedPublic= TeamTopic.SHARED_PUBLIC_TRUE;
 * 如果分享到联盟组,TeamTopic.sharedTeam 保存被分享的组，用,分割组ID
 */
@Entity
@Table(name="team_topic")
public class TeamTopic extends BaseObject{

	private static final long serialVersionUID = 776267276662045914L;

	@Id
	@Column(name="team_topic_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long ttid;
	
	@Column(name="userid")
	private Long userid;
	
	@Column(name="teamid")
	private Long teamid;
	
	@Column(name="topicid")
	private Long topicid;
	
	/**
	 * 此贴是否共享到社区 ConstantDB.TEAM_TOPIC_SHARE_PUBLIC
	 */
	@Column(name="share_public")
	private String sharePublic;
	/**
	 * 此贴是否共享到联盟组 ConstantDB.TEAM_TOPIC_SHARE_TEAM
	 * 如果共享了，那么从TeamProperty共享组中将所有的组ID，COPY过来，以,分割，第一个和最后一个字符必须是,因为查找TEAMTOPIC是like %,1,%
	 */
	@Column(name="shared_team")
	private String sharedTeam;

	/**
	 * 在组内是否可用，不影响在版区是否可用
	 * 1, 组内可用，版区不可用 TeamTopic.enabled = true, Topic.enabled= false
	 * 2, 组内可用，版区可用 TeamTopic.enabled = true, Topic.enabled= true
	 * 3, 组内不可用，版区可用 TeamTopic.enabled = false, Topic.enabled= true
	 * 4, 组内不可用，版区不可用 TeamTopic.enabled = false, Topic.enabled=false
	 */
	@Column(name="enabled")
	private Short enabled;
	
	public Long getTtid() {
		return ttid;
	}

	public void setTtid(Long ttid) {
		this.ttid = ttid;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public Long getTeamid() {
		return teamid;
	}

	public void setTeamid(Long teamid) {
		this.teamid = teamid;
	}

	public Long getTopicid() {
		return topicid;
	}

	public void setTopicid(Long topicid) {
		this.topicid = topicid;
	}

	public String getSharePublic() {
		return sharePublic;
	}

	public void setSharePublic(String sharePublic) {
		this.sharePublic = sharePublic;
	}

	public String getSharedTeam() {
		return sharedTeam;
	}

	public void setSharedTeam(String sharedTeam) {
		this.sharedTeam = sharedTeam;
	}

	public Short getEnabled() {
		return enabled;
	}

	public void setEnabled(Short enabled) {
		this.enabled = enabled;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}
